<?
class test{
	private $reg;
	function __construct(){
		$this->load();
	}
	function load(){
		include('sys.php');
	}
	function edit(){
		$next=count($this->reg['section1']);
		$this->reg['section1']['test'.$next]='bbb'.$next;
	}
	function show(){
		echo "<pre>",print_r( $this->reg ,true),"</pre>";
	}
	function save(){
		$fh=fopen('sys.php','w');
		$out=var_export($this->reg,true);
		$out='<'.'?php $this->reg=' . $out . '; ?'.'>';
		$out=preg_replace("|>\s*arr|","> arr",$out);
		fputs($fh,$out); fclose($fh);
	}
}

$reg=new test();
$reg->edit();
$reg->show();
$reg->save();
?>
